package com.iss.okair.db.mapper;

import com.iss.okair.db.entity.AssetsNormal;
import com.iss.okair.db.model.AssetsNormalMode;
import com.iss.okair.db.mapper.sql.AssetsNormalSQL;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface AssetsNornalMapper {
    @SelectProvider(type = AssetsNormalSQL.class,method = "find")
    List<AssetsNormal> select(AssetsNormalMode model);

    //添加
    @Insert("insert into assets_normal values(#{id},#{assetscode},#{assetstype},#{namecn},#{normalbrand},#{normalmodel},#{packagetype},#{supplier},#{suppliertel},#{consumptive},NOW(),#{createuser},#{comment})")
    int add(AssetsNormal normal);
    //查询全部记录的方法
    @Select("select count(*) from assets_normal")
    int countALL();
    //修改的方法
    @UpdateProvider(type = AssetsNormalSQL.class,method = "update")
    int update(AssetsNormal normal);
    //根据主键查询数据信息
    @Select("select * from assets_normal where id=#{id}")
    AssetsNormal selectById(@Param("id") String id);

}
